<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>uni_app中的props类型及其默认值</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
  </style>
</head>

<body>
  <div></div>
</body>
<script>
  "use strict"; {
    /* 
      props: {
        demoString: {
          type: String,
          default: ''
        },
        demoNumber: {
          type: Number,
          default: 0
        },
        demoBoolean: {
          type: Boolean,
          default: true
        },
        demoArray: {
          type: Array,
          default: () => []
        },
        demoObject: {
          type: Object,
          default: () => ({})
        },
        demoFunction: {
          type: Function,
          default: function () { }
        }
      }
      
      其中对象也可以写成这样
      demoObject: {
        type: Object,
        default: function () {
          return {}
        }
      }
    */
  };
</script>

</html>